package com.hhkj.study.admin.article.model.res;

import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.Lists;
import com.hhkj.study.admin.article.model.podo.ArticleExamFlowPo;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;
import java.util.Map;

/**
*
* @author SERVER
* @since 2024-09-06
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class ArticleExamFlowRes extends ArticleExamFlowPo {

    /**
     * 所有关联的资讯名称,用|隔开
     */
    private String articleName;


    private List<Map<String, Object>> articleMap;

    private List<Map<String, Object>> courseTypeMap;
    /**
     * 课程类别|隔开
     */
    private String courseTypeName;

    private List<Map<String, Object>> provinceMap;
    /**
     * 所属区域|隔开
     */
    private String provinceName;


    @JsonIgnore
    @Override
    public List<Long> getArticleIdList() {
        if (StrUtil.isBlank(getArticleIds())) {
            return Lists.newArrayList();
        }
        return JSONUtil.toList(getArticleIds(), Long.class);
    }

    @JsonIgnore
    @Override
    public List<Long> getCourseTypeList() {
        if (StrUtil.isBlank(getCourseTypes())) {
            return Lists.newArrayList();
        }
        return JSONUtil.toList(getCourseTypes(), Long.class);
    }

    @JsonIgnore
    @Override
    public List<Long> getProvinceIdList() {
        if (StrUtil.isBlank(getProvinceIds())) {
            return Lists.newArrayList();
        }
        return JSONUtil.toList(getProvinceIds(), Long.class);
    }
}